package com.si.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

@Entity
@Table(name="t_info")
public class Info {

	/**
	 * id
	 */
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;
	
	/**
	 * 信息类型
	 */
	@OneToOne(fetch = FetchType.EAGER,optional=true)
	@JoinColumn(name = "info_type_id",nullable=false)
	@Cascade({org.hibernate.annotations.CascadeType.REFRESH})
	private InfoTypeClassA infoTypeClassA;
	
	/**
	 * 标题
	 */
	@Column(name = "cn_name",length=200)
	private String cnName;
	
	/**
	 * 内容
	 */
	@Column(name="cn_content", columnDefinition="TEXT")
	private String cnContent;
	
	
	/**
	 * 视频地址
	 */
	@Column(name = "voide_url",length=300)
	private String voideUrl;
	
	/**
	 *  录入日期
	 */
	@Column(name = "create_date")
	private Date createDate;

	/**
	 * 浏览量
	 */
	@Column(name = "volume",length=6)
	private Integer volume;

	/**
	 *封面
	 */
	@Column(name = "image",length=60)
	private String image;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public InfoTypeClassA getInfoTypeClassA() {
		return infoTypeClassA;
	}

	public void setInfoTypeClassA(InfoTypeClassA infoTypeClassA) {
		this.infoTypeClassA = infoTypeClassA;
	}

	public String getCnName() {
		return cnName;
	}

	public void setCnName(String cnName) {
		this.cnName = cnName;
	}

	public String getCnContent() {
		return cnContent;
	}

	public void setCnContent(String cnContent) {
		this.cnContent = cnContent;
	}

	public String getVoideUrl() {
		return voideUrl;
	}

	public void setVoideUrl(String voideUrl) {
		this.voideUrl = voideUrl;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Integer getVolume() {
		return volume;
	}

	public void setVolume(Integer volume) {
		this.volume = volume;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}
	
	
}
